09. Download Python (Mac)
Download Python (Mac)
Installing Python
Hi there! These instructions will walk you through all of the steps needed to install Python onto your computer. This particular page contains instructions for Mac OS X.
NOTE: If you have a Windows PC, please click Previous or otherwise navigate to the previous page in order to find instructions for your particular platform! If you already have Python installed, proceed to the next lesson by clicking on Next.
To install Python on your Mac, you have two options: via the command line using Homebrew, or via the normal Python installer from their website.
Method 1: Package Installer
Go to the Python downloads page that contains downloads for the most recent versions of Python. This course was designed with Python 2 in mind, so choose that installer instead of Python 3.
If you are using Mac OS X 10.6 or later, download the installer linked from that page. If you are using 10.5, you will need an alternate installer, the 32-bit i386/PPC installer.
Open the file that you downloaded. It should either be called
python-2.7.12-macosx10.6.pkg
orpython-2.7.12-macosx10.5.pkg
. Note: The images below show Python 2.7.9, but the process is unchanged in more recent versions.Follow the steps in the Python Installer to successfully install Python.
To confirm that your installation was successful, open IDLE, a program installed by Python that makes it easy to edit and run Python code.
a) It should be in your Applications folder.
b) You can also use Spotlight by pressing ⌘+Space and typing in "idle" to find it.
Here's a picture of it running on our computer!
Method 2: Homebrew
To install Python via Homebrew, there are only two steps:
Open up your terminal and enter the following command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
. You will be prompted several times during the installation process.When you're done installing Homebrew, you can verify everything worked by typing the
brew help
command at the command line. Now, just typebrew install python
to get the latest version of Python 2. That's all there is to it!
Verify that Python installed correctly by simply typing python
at the command line. You should be greeted by the Python Shell.
- Hooray, you're done! You can also use homebrew to conveniently install other software.